{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "28b92ef8d4bb023",
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-10-31T02:10:08.309071600Z",
     "start_time": "2023-10-31T02:10:08.152459400Z"
    }
   },
   "outputs": [],
   "source": [
    "import os\n",
    "import shutil\n",
    "\n",
    "# 指定目录\"DATA\"\n",
    "path = \"DATA\"\n",
    "\n",
    "# 在\"DATA\"文件夹中创建\"normal\"和\"potholes\"文件夹\n",
    "os.mkdir(os.path.join(path,\"normal\"))\n",
    "os.mkdir(os.path.join(path,\"potholes\"))\n",
    "\n",
    "# 读取\"DATA\"文件夹，若文件名中含有\"normal\"，则将其放置于\"normal\"文件夹中，否则放置于\"potholes\"文件夹中\n",
    "files = os.listdir(path)\n",
    "for file in files:\n",
    "    if \"normal\" in file:\n",
    "        shutil.move(os.path.join(path,file),os.path.join(path,\"normal\"))\n",
    "    else:\n",
    "        shutil.move(os.path.join(path,file),os.path.join(path,\"potholes\"))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
